﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

using TTBusiness.ClassDB;
using TTBusiness.DB_Linq;
namespace Indochinaodyssey.UserControl.Slide
{
    public partial class ucHotToursSlide : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblHotTours.Text = SliderHotTours();
        }

        private string SliderHotTours()
        {
            try
            {
                //
                List<tblImage> ds = new List<tblImage>();
                clsBSImage obj = new clsBSImage();
                ds = obj.getByTypeId(5);

                StringBuilder menu = new StringBuilder();
                menu.Append("<div id=\"gallery\">");
               
                for (int i = 0; i < ds.Count; i++)
                {
                    if (i==0)
                    {
                        menu.Append("<a href=\""+ds[i].Link +"\" class=\"show\">");
                    }
                    else
                    {
                        menu.Append("<a href=\"" + ds[i].Link + "\">");
                    }
                    menu.Append("<img src=\"Image/Upload/" + ds[i].Name + "\" alt=\"\" alt=\"\" title=\"\" width=\"760px\" height=\"250px\" rel=\"" + ds[i].Summary + "\"/></a>");
                }
                menu.Append("<div class=\"caption\"><div class=\"content\"></div></div>");
                menu.Append("</div> ");
                return menu.ToString();
            }
            catch
            {
                throw;
            }
        }
    }
}